package org.jetlinks.community.mstn.handler;

import org.hswebframework.web.aop.MethodInterceptorHolder;
import org.hswebframework.web.authorization.annotation.QueryAction;
import org.hswebframework.web.logging.AccessLogger;
import org.jetlinks.community.mstn.annotation.MstnAssetsController;
import org.springframework.core.annotation.AnnotationUtils;

import java.lang.reflect.Method;

public class MstnAssetsTypeDefaultHandler implements MstnAssetsTypeHandler{

    @Override
    public boolean support(Class<?> var1, Method var2) {
        return true;
//        MstnAssetsController ann = AnnotationUtils.findAnnotation(var2, MstnAssetsController.class);
//        return null != ann && !ann.ignore();
    }

    @Override
    public MstnAssetsDefine parse(MethodInterceptorHolder holder) {
        MstnAssetsController methodAnn = holder.findMethodAnnotation(MstnAssetsController.class);
        MstnAssetsController classAnn = holder.findClassAnnotation(MstnAssetsController.class);
        return MstnAssetsDefine.of(methodAnn,classAnn);
    }
}